<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
        div{

        }
        input{
            width: 200px;
            height: 30px;
            border: 1px solid silver;
        }
        .danxuannannu{

            position:fixed;
            button:5px;
            width:10px
        }
        .fuxuan{
            width: 85px;
        }
    </style>
    <script>
        var load=function(){
            var input=document.getElementById("qiyemingcheng")      //验证企业名称
            input.onfocus=function(){
                this.style.border="1px solid blue"
                this.style.boxShadow="0px 0px 5px 0px blue"
                var td=document.getElementById("tishi")
                    td.innerHTML="请输入与公司营业执照一致的公司全称，2-64个中文"

                input.onblur=function(){
                    this.style.border="1px solid red"
                    this.style.boxShadow="0px 0px 5px 0px red"
                    var td=document.getElementById("tishi")
                    td.style.color="red"
                    var data=this.value
                    var reg=/[\u4e00-\u9fa5]{1,63}/
                    reg=reg.test(data)

                    if (reg){
                        this.style.border="1px solid silver"
                        this.style.boxShadow="0px 0px 5px 0px blue"
                        var td=document.getElementById("tishi")
                        td.innerHTML="√"

                    }else{
                        this.style.border="1px solid red"
                        this.style.boxShadow="0px 0px 5px 0px red"
                        var td=document.getElementById("tishi")
                        td.style.color="red"
                    }
                }
            }


            var input1=document.getElementById("suozaidi")   //验证所在地
                input1.onfocus=function() {
                this.style.border = "1px solid blue"
                this.style.boxShadow = "0px 0px 5px 0px blue"
                var td = document.getElementById("suozaidi_tishi")
                td.innerHTML = "请选择公司所在地，以办公地点为准"

                input1.onblur = function () {
                    this.style.border = "1px solid red"
                    this.style.boxShadow = "0px 0px 5px 0px red"
                    var td = document.getElementById("suozaidi_tishi")
                    td.style.color = "red"
                    var data = this.value
                    var reg = /[\u4e00-\u9fa5]/
                    reg = reg.test(data)

                    if (reg) {
                        this.style.border = "1px solid silver"
                        this.style.boxShadow = "0px 0px 5px 0px blue"
                        var td = document.getElementById("suozaidi_tishi")
                        td.innerHTML = "√"

                    } else {
                        this.style.border = "1px solid red"
                        this.style.boxShadow = "0px 0px 5px 0px red"
                        var td = document.getElementById("suozaidi_tishi")
                        td.style.color = "red"
                    }
                }
            }

            var input2=document.getElementById("lianxiren")   //验证联系人
            input2.onfocus=function() {
                this.style.border = "1px solid blue"
                this.style.boxShadow = "0px 0px 5px 0px blue"
                var td = document.getElementById("lianxiren_tishi")
                td.innerHTML = "请输入招聘联系人，可由中文或英文组成"

                input2.onblur = function () {
                    this.style.border = "1px solid red"
                    this.style.boxShadow = "0px 0px 5px 0px red"
                    var td = document.getElementById("lianxiren_tishi")
                    td.style.color = "red"
                    var data = this.value
                    var reg = /[\u4e00-\u9fa5]/
                    reg = reg.test(data)

                    if (reg) {
                        this.style.border = "1px solid silver"
                        this.style.boxShadow = "0px 0px 5px 0px blue"
                        var td = document.getElementById("lianxiren_tishi")
                        td.innerHTML = "√"

                    } else {
                        this.style.border = "1px solid red"
                        this.style.boxShadow = "0px 0px 5px 0px red"
                        var td = document.getElementById("lianxiren_tishi")
                        td.style.color = "red"
                    }
                }
            }
            var input3=document.getElementById("lianxidianhua")   //验证联系电话
            input3.onfocus=function() {
                this.style.border = "1px solid blue"
                this.style.boxShadow = "0px 0px 5px 0px blue"
                var td = document.getElementById("lianxidianhua_tishi")
                td.innerHTML = "请填写手机号"

                input3.onblur = function () {
                    this.style.border = "1px solid red"
                    this.style.boxShadow = "0px 0px 5px 0px red"
                    var td = document.getElementById("lianxidianhua_tishi")
                    td.style.color = "red"
                    var data = this.value
                    var reg = /(\(\d{3,4}\)|\d{3,4}-)?\d{7,8}/
                    reg = reg.test(data)

                    if (reg) {
                        this.style.border = "1px solid silver"
                        this.style.boxShadow = "0px 0px 5px 0px blue"
                        var td = document.getElementById("lianxidianhua_tishi")
                        td.innerHTML = "√"

                    } else {
                        this.style.border = "1px solid red"
                        this.style.boxShadow = "0px 0px 5px 0px red"
                        var td = document.getElementById("lianxidianhua_tishi")
                        td.style.color = "red"
                    }
                }
            }
            var input15=document.getElementById("yonghuming")   //验证用户名
            input15.onfocus=function() {
                this.style.border = "1px solid blue"
                this.style.boxShadow = "0px 0px 5px 0px blue"
                var td = document.getElementById("yonghuming_tishi")
                td.innerHTML = "请输入英文字母、数字及-或_，且首字符必须为字母或数字，长度为6到24个字符"

                input15.onblur = function () {
                    this.style.border = "1px solid red"
                    this.style.boxShadow = "0px 0px 5px 0px red"
                    var td = document.getElementById("yonghuming_tishi")
                    td.style.color = "red"
                    var data = this.value
                    var reg = /[a-zA-Z0-9_]+[a-zA-Z0-9_]{5,23}/
                    reg = reg.test(data)

                    if (reg) {
                        this.style.border = "1px solid silver"
                        this.style.boxShadow = "0px 0px 5px 0px blue"
                        var td = document.getElementById("yonghuming_tishi")
                        td.innerHTML = "√"

                    } else {
                        this.style.border = "1px solid red"
                        this.style.boxShadow = "0px 0px 5px 0px red"
                        var td = document.getElementById("yonghuming_tishi")
                        td.style.color = "red"
                    }
                }
            }
            var input18=document.getElementById("dianziyouxiang")   //验证电子邮箱
            input18.onfocus=function() {
                this.style.border = "1px solid blue"
                this.style.boxShadow = "0px 0px 5px 0px blue"
                var td = document.getElementById("dianziyouxiang_tishi")
                td.innerHTML = "请输入常用的邮箱"

                input18.onblur = function () {
                    this.style.border = "1px solid red"
                    this.style.boxShadow = "0px 0px 5px 0px red"
                    var td = document.getElementById("dianziyouxiang_tishi")
                    td.style.color = "red"
                    var data = this.value
                    var reg =  /([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,4}/;
                    reg = reg.test(data)

                    if (reg) {
                        this.style.border = "1px solid silver"
                        this.style.boxShadow = "0px 0px 5px 0px blue"
                        var td = document.getElementById("dianziyouxiang_tishi")
                        td.innerHTML = "√"

                    } else {
                        this.style.border = "1px solid red"
                        this.style.boxShadow = "0px 0px 5px 0px red"
                        var td = document.getElementById("dianziyouxiang_tishi")
                        td.style.color = "red"
                    }
                }
            }
            var input21=document.getElementById("mima")   //验证密码
            input21.onfocus=function() {
                this.style.border = "1px solid blue"
                this.style.boxShadow = "0px 0px 5px 0px blue"
                var td = document.getElementById("mima_tishi")
                td.innerHTML = "8-20位非规律字母或数字组成，且不能与登录名称相同"

                input21.onblur = function () {
                    this.style.border = "1px solid red"
                    this.style.boxShadow = "0px 0px 5px 0px red"
                    var td = document.getElementById("mima_tishi")
                    td.style.color = "red"
                    var data = this.value
                    var reg = /[^[zA-Z]\w{7,19}$]/
                    reg = reg.test(data)

                    if (reg) {
                        this.style.border = "1px solid silver"
                        this.style.boxShadow = "0px 0px 5px 0px blue"
                        var td = document.getElementById("mima_tishi")
                        td.innerHTML = "√"

                    } else {
                        this.style.border = "1px solid red"
                        this.style.boxShadow = "0px 0px 5px 0px red"
                        var td = document.getElementById("mima_tishi")
                        td.style.color = "red"
                    }
                }
            }
            var input19=document.getElementById("mimaqueren")   //验证密码确认
            input19.onfocus=function() {
                this.style.border = "1px solid blue"
                this.style.boxShadow = "0px 0px 5px 0px blue"
                var td = document.getElementById("mimaqueren_tishi")
                td.innerHTML = "请再次输入密码"

                input19.onblur = function () {
                    this.style.border = "1px solid red"
                    this.style.boxShadow = "0px 0px 5px 0px red"
                    var td = document.getElementById("mimaqueren_tishi")
                    td.style.color = "red"
                    var data = this.value
                    var reg = /[^[zA-Z]\w{7,19}$]/
                    reg = reg.test(data)

                    if (reg) {
                        this.style.border = "1px solid silver"
                        this.style.boxShadow = "0px 0px 5px 0px blue"
                        var td = document.getElementById("mimaqueren_tishi")
                        td.innerHTML = "√"

                    } else {
                        this.style.border = "1px solid red"
                        this.style.boxShadow = "0px 0px 5px 0px red"
                        var td = document.getElementById("mimaqueren_tishi")
                        td.style.color = "red"
                    }
                }
            }
        }
    </script>

</head>
<body onload="load ()">
    注册信息
    <div id="zhuce">
        <table border="0">
            <tr>
                <td>*企业名称：</td>
                <td><input  id="qiyemingcheng" type="text"/></td>
                <td id="tishi"></td>
            </tr>
            <tr>
                <td>*所在地</td>
                <td >     <input class="fuxuan" id="suozaidi-" />省<input class="fuxuan" id="suozaidi" />市</td>
                <td id="suozaidi_tishi"></td>
            </tr>
            <tr>
                <td>*联系人</td>
                <td><input  id="lianxiren"/><input type="radio" name="xingbie"class="danxuannannu" />&nbsp;男<input type="radio" name="xingbie" class="danxuannannu" />&nbsp;女</td>
                <td id="lianxiren_tishi"></td>
            </tr>
            <tr>
                <td>联系电话</td>
                <td><input id="lianxidianhua"/></td>
                <td id="lianxidianhua_tishi"></td>
            </tr>
        </table>
    </div>
    账户信息
    <div id="zhanghu">
        <table>
            <tr>
                <td>*用户名</td>
                <td><input id="yonghuming"/></td>
                <td id="yonghuming_tishi"></td>
            </tr>
            <tr>
                <td>*电子邮箱</td>
                <td><input id="dianziyouxiang"/></td>
                <td id="dianziyouxiang_tishi"></td>
            </tr>
            <tr>
                <td>*密码</td>
                <td><input id="mima"/></td>
                <td id="mima_tishi"></td>
            </tr>
            <tr>
                <td>*密码确认</td>
                <td><input id="mimaqueren"/></td>
                <td id="mimaqueren_tishi"></td>
            </tr>
        </table>
    </div>



</body>
</html>